﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class Admin_Admin_XemChiTietTaiKhoan : System.Web.UI.Page
{
    string CMND = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["CMND"] == null)
        {
            Response.Redirect("~/Default.aspx");
        }
        CMND = Request["CMND"];
        DataDSTableAdapters.TAIKHOANTableAdapter tkadapter = new DataDSTableAdapters.TAIKHOANTableAdapter();
        DataDS.TAIKHOANDataTable tktable = tkadapter.TAIKHOAN_LayTheoCMND(CMND);

        lblCMND.Text = CMND;
        lblDiaChi.Text = (string)tktable.Rows[0]["DiaChi"];
        lblDienThoai.Text = tktable.Rows[0]["DienThoai"].ToString();
        lblEmail.Text = tktable.Rows[0]["Email"].ToString();
        lblHoTen.Text = tktable.Rows[0]["HoTen"].ToString();
        if (tktable[0].TrangThai == true)
            lbTrangThai.Text = "Đã kích hoạt";
        else
            lbTrangThai.Text = "Chưa kích hoạt";
        //lblMaTK.Text = tktable.Rows[0]["MaTaiKhoan_NganHang"].ToString();
        switch (tktable.Rows[0]["Role"].ToString())
        {
            case "1":
                lblVaiTro.Text = "Admin";
                break;
            case "2":
                lblVaiTro.Text = "Khách hàng thân thiết";
                break;
            case "3":
                lblVaiTro.Text = "Khách hàng đại chúng";
                break;
        }
        
        Image1.ImageUrl = tktable.Rows[0]["Avatar"].ToString();
        

        
    }
    protected void btnThem_Click(object sender, EventArgs e)
    {
        Response.Redirect("Admin_CapNhatTaiKhoan.aspx?CMND=" + CMND);
    }
}
